package com.acoreful.sample.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.acoreful.sample.commons.data.jpa.DynamicQuery;
import com.acoreful.sample.dao.UserDao;
import com.acoreful.sample.entity.User;
import com.acoreful.sample.service.UserMngService;
@Service
public class UserMngServiceImpl implements UserMngService {
	@Autowired
	private UserDao userDao;
	@Autowired
	private DynamicQuery dynamicQuery;

	@Override
	public void save(User user) {
		userDao.save(user);
		
	}

	@Override
	public User get(Long id) {
		return userDao.findOne(id);
	}
	@Override
	public List<User> findAll() {
		return dynamicQuery.query(User.class,"from User");
	}

	@Override
	public User findUserByLoginName(String loginName) {
		return null;
	}
}
